<?php $view->extend('layout_admin.php') ?>

<section class="content-header">
    <h1>
        Personnel
        <small>Liste</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Personnel</a></li>
        <li class="active">Liste</li>
    </ol>
</section>

<div class="row">
    <div class="col-12">
    <h1>Liste des personnels</h1>
        <table class="table table-hover">
          <thead>
            <tr>
              <th>Nom</th>
              <th>Prenom</th>
              <th>Sexe</th>
              <th>Date de Naissance</th>
              <th>Nationalité</th>
              <th>Poste</th>
            </tr>
          </thead>
          <tbody>
            <?php 
                foreach ($personnel as $p) {
                $date = $p->getDateNaissance();
             ?>
                <tr>
                  <td><?php echo $p->getNom() ?></td>
                  <td><?php echo $p->getPrenom() ?></td>
                  <td><?php if($p->getSexe() =="F"){ echo "Femme"; }else{ echo "Homme";} ?></td>
                  <td><?php if($date) echo $date->format('Y-m-d');  ?></td>
                  <td><?php echo $p->getNationalite() ?></td>
                  <td><?php echo $p->getPoste() ?></td>
                </tr>
             <?php
                }
            ?>
          </tbody>
        </table>
    </div>
</div>
